define(["backend"], function (Backend) {
    //详情页点击图片放大
    $("body").on("click", "[data-tips-image]", function () {
        var img = new Image();
        var imgWidth = this.getAttribute("data-width") || "480px";
        img.onload = function () {
            var $content = $(img).appendTo("body").css({background: "#fff", width: imgWidth, height: "auto"});
            Layer.open({
                type: 1, area: imgWidth, title: false, closeBtn: 1,
                skin: "layui-layer-nobg", shadeClose: true, content: $content,
                end: function () {
                    $(img).remove();
                },
                success: function () {

                }
            });
        };
        img.onerror = function (e) {

        };
        img.src = this.getAttribute("data-tips-image") || this.src;
    });


    //引入layui
    require.config({
        paths: {
            "layui": "../libs/layui/src/layui",
        },
        shim: {
            "layui":{
                deps:["css!../libs/layui/src/css/layui.css"],
                exports: "layui"
            },
        }
    });

    //引入layuiadmin
    /*require.config({
        paths: {
            "layuiadmin": "../libs/layuiadmin/layui/layui",
        },
        shim: {
            "layuiadmin":{
                deps:["css!../libs/layuiadmin/layui/css/layui.css"],
                exports: "layuiadmin"
            },
        }
    });
*/
});
